import 'package:flutter/material.dart';

import '../const/cosnt.dart';

class BottomButton extends StatelessWidget {
  final String title;
  final Function()? onTap;
  final Color bgColor;
  final EdgeInsets? margin;
  final Color fontColor;
  const BottomButton(
      {Key? key,
      required this.title,
      this.fontColor = Colors.white,
      this.bgColor = AppColor.mainColor,
      this.onTap,
      this.margin})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;

    return Padding(
      padding: margin ?? const EdgeInsets.all(15),
      child: InkWell(
        onTap: onTap,
        child: Container(
          width: size.width,
          height: 50,
          decoration: BoxDecoration(borderRadius: BorderRadius.circular(3), color: bgColor),
          alignment: Alignment.center,
          child: Text(
            title,
            style: AppFont.textStyle(15, color: this.fontColor),
          ),
        ),
      ),
    );
  }
}
